<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="test"></div>
  <div id="test1"></div>
  <div id="test2"></div>

  <script src="../js/react.development.js"></script>
  <script src="../js/react-dom.development.js"></script>
  <script src="../js/babel.min.js"></script>

  <script type="text/babel">
    class Person extends React.Component {
      render() {
        return (
          <ul>
            <li>姓名:{this.props.name}</li>
            <li>年龄:{this.props.age + 1}</li>
            <li>性别:{this.props.gender}</li>
          </ul>
        )
      }
    }

    ReactDOM.render (<Person name='tom' age='18' gender='male' />, document.getElementById ('test'))
    ReactDOM.render (<Person name='mark' age={18} gender='male' />, document.getElementById ('test2'))

    // 批量传递props
    const p = {name:'jack', age:18, gender:'male'}
    ReactDOM.render (<Person {...p} />, document.getElementById ('test1'))
  </script>
</body>
</html>